// import axios from 'axios'
// import router from '../router'
// import config from '../common/config'
import func from '@/common/func'

// const baseUrl = config.baseUrl

export default {
    uploadUrl: function() {
        return func.uploadUrl()
        // let user = JSON.parse(localStorage.getItem('user')) || {};
        // let access_token = user.access_token || ''
        // return `${baseUrl}/ajax/upload?access_token=${access_token}`
    },
    request: function (url_path, params, obj) {
        return func.request(url_path, params, obj)
        /*let user = JSON.parse(localStorage.getItem('user')) || {};
        return axios.post(`${baseUrl}${url_path}`, params, {
            headers: {
                "Authorization": 'Bearer ' + (user.access_token || ''),
                "Content-Type": 'application/x-www-form-urlencoded',
            },
        }).then(res => {
            if (res.data.code !== 1) {
                if (obj) {
                    obj.$message({
                        message: res.data.msg,
                        type: 'error'
                    });
                }
            }
            if (res.data.code === 301) {
                router.push({path:'/login'});
            }
            return res.data
        });*/
    }
}